<?php
	$paymentMode = array('' => 'Select Payment Mode...', 'Cash' => 'Cash', 'Cheque' => 'Cheque', 'Credit Card' => 'Credit Card');
	$relationMode = array('' => 'Select Relationship to Applicant...', 'Father of' => 'Father', 'Mother of' => 'Mother', 'Guardian of' => 'Guardian');
	$creditcardname = array('' => 'Select Credit Card Name', 'Visa' => 'Visa', 'Master' => 'Master', 'Amex' => 'Amex', 'Debit' => 'Debit');
	if($payee != FALSE){
		$firstname = set_value('firstname',$payee->firstname);
		$middlename = set_value('middlename',$payee->middlename);
		$lastname = set_value('lastname',$payee->lastname);
		$name_ext = set_value('name_ext',$payee->name_ext);
		$relation = set_value('relation',$payee->relation);
	}else{
		$firstname = set_value('firstname','');
		$middlename = set_value('middlename','');
		$lastname = set_value('lastname','');
		$name_ext = set_value('name_ext','');
		$relation = set_value('relation','');
	}
	//var_dump($applicants);
?>

<div class="section-container auto" data-section>
  <section class="active">
    <p class="title" data-section-title><a href="#panel1">Payment Center Assessment Fee</a></p>
    <div class="content" data-section-content>
		<p>
		
		<?php
			$token = "";
		?>
		<?echo form_open('applicant/assessment_fee_update/'.$applicants->e_id,'class="custom" autocomplete="off""');?>
		<div>
			
			<div class="row collapse">
				<span style="font-size:10px; color:red; display:none;" id="firstname_notice">Payee's Name cannot be blank or must be complete. Required entry</span>
				<div class="small-4 large-4 columns">
					<span class="prefix">Payee's First Name</span>
				</div>
				<div class="small-3 large-3 columns">
					<input type="text" id="firstname" name="firstname" autocomplete="off" placeholder="First Name" value="<?php echo ucwords(strtolower($firstname)); ?>" class="postfix">
				</div>
				<div class="small-2 large-2 columns">
					<input type="text" id="middlename" name="middlename" autocomplete="off" placeholder="Middle Name" value="<?php echo ucwords(strtolower($middlename)); ?>" class="postfix">
				</div>
				<div class="small-2 large-2 columns">
					<input type="text" id="lastname" name="lastname" autocomplete="off" placeholder="Last Name" value="<?php echo ucwords(strtolower($lastname)); ?>" class="postfix">
				</div>
				<div class="small-1 large-1 columns">
					<input type="text" id="name_ext" name="name_ext" autocomplete="off" placeholder="Jr, II etc" value="<?php echo $name_ext=='jr' || $name_ext == 'sr' ? ucwords(strtolower($name_ext)):strtoupper($name_ext); ?>" class="postfix">
				</div>
			</div>
			<!--
			<div class="row collapse">
				<div class="small-4 large-4 columns">
					<span class="prefix">Payee's Middle Name</span>
				</div>
				<div class="small-8 large-8 columns">
					<input type="text" id="middlename" name="middlename" autocomplete="off" placeholder="Payee's Middle Name">
				</div>
			</div>

			<div class="row collapse">
				<span style="font-size:10px; color:red; display:none;" id="lastname_notice">Payee's Last Name cannot be blank. Required entry.</span>
				<div class="small-4 large-4 columns">
					<span class="prefix">Payee's Last Name</span>
				</div>
				<div class="small-8 large-8 columns">
					<input type="text" id="lastname" name="lastname" autocomplete="off" placeholder="Payee's Last Name">
				</div>
			</div>

			<div class="row collapse">
				<div class="small-4 large-4 columns">
					<span class="prefix">Payee's Name Extension</span>
				</div>
				<div class="small-8 large-8 columns">
					<input type="text" id="name_ext" name="name_ext" autocomplete="off" placeholder="Payee's Name Extension">
				</div>
			</div>
			-->
			<div class="row collapse">
				<span style="font-size:10px; color:red; display:none;" id="relation_notice">Choice a Relation. Required entry.</span>
				<div class="small-4 large-4 columns">
					<span class="prefix">Relationship to Applicant</span>
				</div>
				<div class="small-8 large-8 columns">
					<?php echo form_dropdown('relation', $relationMode, set_value('relation'), 'id="relation"');?>
				</div>
			</div>

			<div class="row collapse">
				<div class="small-4 large-4 columns">
					<span class="prefix">Fullname</span>
				</div>
				<div class="small-8 large-8 columns">
					<input type="text"  style="text-transform: capitalize;" value="<?php echo ucwords(strtolower($applicants->firstname)); ?><?php echo $applicants->middlename!='' ? ' '.ucwords(strtolower($applicants->middlename)):'';?><?php echo ' '.ucwords(strtolower($applicants->lastname)); ?><?php if($applicants->name_ext!=''){ echo $applicants->name_ext=='jr' || $applicants->name_ext == 'sr' ? ' '.ucwords(strtolower($applicants->name_ext)):strtoupper($applicants->name_ext); }else{ echo ''; } ?>" disabled="disabled" />
				</div>
			</div>
			
			<div class="row collapse">
				<span style="font-size:10px; color:red; display:none;" id="spr_or_no_notice">Payment OR number cannot be blank. Required entry.</span>
				<div class="small-4 large-4 columns">
					<span class="prefix">OR Number</span>
				</div>
				<div class="small-8 large-8 columns">
					<input type="text" id="spr_or_no" name="spr_or_no" autocomplete="off" placeholder="Payment OR Number">
				</div>
			</div>
		
			<div class="row collapse">
				<div class="small-4 large-4 columns">
					<span class="prefix">Date of Payment</span>
				</div>
				<div class="small-8 large-8 columns">
					<input type="text" name="date_of_payment" autocomplete="off"  placeholder="MM/DD/YYY " class ="datepicker-payment">
				</div>
			</div>
			
			<div class="row collapse">
				<span style="font-size:10px; color:red; display:none;" id="schedule_for_testing_notice">Schedule of Testing cannot be blank. Required entry.</span>
				<div class="small-4 large-4 columns">
					<span class="prefix">Schedule of Testing</span>
				</div>
				<div class="small-8 large-8 columns">
					<input type="text" id="schedule_for_testing" name="schedule_for_testing" value="<?php echo $applicants->schedule_for_testing; ?>" autocomplete="off"  >
				</div>
			</div>

			<div class="row collapse">
				<div class="small-4 large-4 columns">
					<span class="prefix">Cheque No.</span>
				</div>
				<div class="small-8 large-8 columns">
					<input type="text" id="cheque_no" name="cheque_no" autocomplete="off" placeholder="Cheque Number">
				</div>
			</div>

			<div class="row collapse">
				<div class="small-4 large-4 columns">
					<span class="prefix">Credit Card No.</span>
				</div>
				<div class="small-8 large-8 columns">
					<input type="text" id="credit_card_no" name="credit_card_no" autocomplete="off" placeholder="Credit Card Number">
				</div>
			</div>

			<div class="row collapse">
				<div class="small-4 large-4 columns">
					<span class="prefix">Credit Card Name</span>
				</div>
				<div class="small-8 large-8 columns">
					<?php echo form_dropdown('credit_card_name', $creditcardname, set_value('credit_card_name'));?>
				</div>
			</div>

			<div class="row collapse">
				<span style="font-size:10px; color:red; display:none;" id="spr_payment_mode_notice">Select a Payment Method. Required entry.</span>
				<div class="small-4 large-4 columns">
					<span class="prefix">Payment Method</span>
				</div>
				<div class="small-8 large-8 columns">
					<?php echo form_dropdown('payment_mode', $paymentMode, set_value('payment_mode'),'id="payment_mode"');?>
				</div>
			</div>
			
			<!--
			<div class="row collapse">
				<div class="small-3 large-3 columns">
					How did you hear of us:
				</div>
				<div class="small-9 large-9 columns" style="margin:2px 0px; padding:2px 0px;">
					<span class="left"><?=form_checkbox('billboard', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Billboard&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('signs_brochures', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Signs/Brochures&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('driving_by', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Driving By&nbsp;&nbsp;</span>
				</div>
			</div>
			
			<div class="row collapse">
				<div class="small-3 large-3 columns">
					&nbsp;
				</div>
				<div class="small-9 large-9 columns" style="margin:2px 0px; padding:2px 0px;">
					<span class="left"><?=form_checkbox('friends_relatives', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Friends/Relatives&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('website', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Website&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('bluebook', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Bluebook&nbsp;&nbsp;</span>
				</div>
			</div>
			
			<div class="row collapse">
				<div class="small-3 large-3 columns">
					&nbsp;
				</div>
				<div class="small-9 large-9 columns" style="margin:2px 0px; padding:2px 0px;">
					<span class="left"><?=form_checkbox('facebook', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Facebook&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('malls', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Malls&nbsp;&nbsp;</span><span class="left"><?=form_checkbox('others', 'yes', FALSE);?></span><span class="left">&nbsp;&nbsp;Others&nbsp;&nbsp;</span><span class="left"><input type="text" name="for_others" autocomplete="off" ></span>
				</div>
			</div>
			-->
			<div class="row collapse">
				<hr class="clearfix">

				<div class="input-fields">
					<div class="large-2 columns">
						<input type="hidden" name="quantity" class="quantity" value="1">
					</div>
					<div class="large-4 columns">
						<label class="label secondary">Description</label>
						<input type="text" value="<?php echo $feedata->fee_name; ?>" disabled>
						<input type="hidden" name="desc" class="description" value="<?php echo $feedata->fee_name; ?>" >
					</div>
					<div class="large-3 columns">
						<label class="label secondary">Unit Price</label>
						<div class="row collapse">
							<div class="small-3 large-2 columns">
								<span id="amount_money" class="prefix">&#8369;</span>
							</div>
							<div class="small-9 large-10 columns">
								<input type="text" value="<?php echo number_format($feedata->fee_rate,2,'.',','); ?>" disabled>
								<input type="hidden" name="price" class="unitprice" value="<?php echo $feedata->fee_rate; ?>" >
							</div>
						</div>
					</div>
					<div class="large-3 columns"></div>
				</div>

				<hr class="clearfix">
				
				<input type="hidden" name="loc_sdi" value="<?echo $token;?>">
				<input type="hidden" name="student_profile_id" value="<?php echo $applicants->e_profile_id; ?>">
				<input type="submit" class="button tiny" id="update_fee" name="update_fee" value="Submit">
			</div>
			
		</div>
		</form>
		
		</p>
    </div>
  </section>
</div>




<script>
	 $('#update_fee').bind('click submit', function(event) {

		if($('#spr_or_no').val()!='' && $('#spr_or_no').val()!=' ')
		{
			$("#spr_or_no_notice").css({ display: "none" });
		}else{
			$("#spr_or_no_notice").css({ display: "block" });
		}
		
		if($('#schedule_for_testing').val()!='' && $('#schedule_for_testing').val()!=' ')
		{
			$("#schedule_for_testing_notice").css({ display: "none" });
		}else{
			$("#schedule_for_testing_notice").css({ display: "block" });
		}

		if($('#payment_mode').val()!='')
		{
			$("#spr_payment_mode_notice").css({ display: "none" });
		}else{
			$("#spr_payment_mode_notice").css({ display: "block" });
		}

		if($('#firstname').val()!='')
		{
			$("#firstname_notice").css({ display: "none" });
		}else{
			$("#firstname_notice").css({ display: "block" });
		}

		if($('#lastname').val()!='')
		{
			$("#firstname_notice").css({ display: "none" });
		}else{
			$("#firstname_notice").css({ display: "block" });
		}

		if($('#relation').val()!='')
		{
			$("#relation_notice").css({ display: "none" });
		}else{
			$("#relation_notice").css({ display: "block" });
		}
	  
		if($('#spr_or_no').val()=='' || $('#spr_or_no').val()==' ' || $('#schedule_for_testing').val()=='' || $('#schedule_for_testing').val()==' ' || $('#payment_mode').val()=='' || $('#firstname').val()==' ' || $('#firstname').val()==''|| $('#lastname').val()==' ' || $('#lastname').val()==''|| $('#relation').val()=='')
		{
			event.preventDefault();
		}

    });
</script>